﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MockDataTransferObject;

namespace Presentation.UserControl
{
    public partial class ListTimesheet : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void TimesheetListView_DataBound(object sender, EventArgs e)
        {
            User user = Session["user"] as User;
            string roleName = user.Role.RoleName;
            foreach (ListViewItem item in TimesheetListView.Items)
            {
                if (roleName != "Consultant")
                {
                    Control control = item.FindControl("OptionPanel");
                    if (control != null)
                    {
                        control.Visible = true;
                    }
                }
            }
        }
    }
}